//
//  XS_PickPhotoCell.swift
//  XueDao
//
//  Created by Mac on 2021/1/15.
//

import UIKit

protocol XS_PickPhotoCellDelegate {
    func photoCell(photoCell: XS_PickPhotoCell, didClickDeleteBtn : UIButton)
}

class XS_PickPhotoCell: UICollectionViewCell {

    
    var delegate : XS_PickPhotoCellDelegate?
    
    @IBOutlet weak var deleteBtn: UIButton!
    var _image : UIImage!
    public var image : UIImage!{
        set{
            _image = newValue
            //设置数据
            imgView.image = newValue
            deleteBtn.isHidden = newValue.size == addImage.size
        }
        get{
            return _image
        }
    }
    
    @IBOutlet weak var imgView: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    @IBAction func deleteBtnAction(_ sender: UIButton) {
        if delegate != nil {
            delegate?.photoCell(photoCell: self, didClickDeleteBtn: sender)
        }
    }
}
